Skip to content

fix(libSceAgcDriver): SPI_PS_INPUT_CNTL registers start at their clear-state value - #2128

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:fix/agc-spi-ps-input-cntl-clear-state
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:fix/agc-spi-ps-input-cntl-clear-state

Conversation

@MathiasDevelopes

Copy link
Copy Markdown
Contributor

What

A title that never writes SPI_PS_INPUT_CNTL_0 (context register 0x191) relies on its clear-state value, 0. The driver's initial context did not contain the SPI_PS_INPUT_CNTL registers. As a result, every draw of a pixel shader with interpolants (SPI_PS_IN_CONTROL.NUM_INTERP > 0) was rejected when [DecodePixelStageInfo](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cpp) read register 0x191.

Planet Coaster (PPSA01736) writes SPI_PS_INPUT_CNTL_1..31 (0x192..0x1b0, values 1..31) and leaves SPI_PS_INPUT_CNTL_0 at its reset value. Without this change it stops at its first UI and video draws:

[videoout] presentation failed: AGC graphics: missing register at DWORD 0x191

On older main the same draws were skipped instead ([gpu] skipped draw: AGC graphics: missing register at DWORD 0x191), and every presented frame was black.

All 32 SPI_PS_INPUT_CNTL registers (0x191..0x1b0) now start at 0 in [InitialContextRegisters](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp). The initial context and CLEAR_STATE already share that table.

Source for the value: the GFX10 clear state in amdgpu, clearstate_gfx10.h lines 427–458. In gfx10_SECT_CONTEXT_def_2, whose extent starts at 0xa0d8, SPI_PS_INPUT_CNTL_0 is entry 185. That is register 0xa191, the driver's 0x191. It and SPI_PS_INPUT_CNTL_1..31 are all 0x00000000.

Tested

Windows 11, MinGW-w64 15.2.0, RTX 3060.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

…r-state value

A title that never writes SPI_PS_INPUT_CNTL_0 relies on its clear-state
value 0, but the register was absent from the initial context, so every
draw of a pixel shader with interpolants was rejected with "missing
register at DWORD 0x191". All 32 SPI_PS_INPUT_CNTL registers now start at
0, as in the GFX10 clear state, both initially and after CLEAR_STATE.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 9, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
@oneandonlydean
oneandonlydean merged commit 7538f22 into boykopovar:main Oct 10, 2026
8 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…ps-input-cntl-clear-state

fix(libSceAgcDriver): SPI_PS_INPUT_CNTL registers start at their clear-state value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants